/*
 * UserNet  --  TCP/IP implementation in userspace
 * Copyright (C) 2010  Alex Diban
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

#ifndef UNET_ROUTES_H
#define UNET_ROUTES_H

#include <stdint.h>
#include "list.h"
#include <netinet/in.h>		/* struct in_addr */
#include <unet/dev.h>


struct unet_route
{
  struct in_addr Destination;
  struct in_addr Genmask;	
  struct in_addr Gateway;
  struct unet_device *interface;		/* puntero al device correspondiente */  
  uint32_t id_interface;
  struct list_head element; 
};

extern int unet_route_add(struct unet_route *route);
extern int unet_route_del(struct unet_route *route);
extern struct unet_device *unet_route_find(struct in_addr Destination);
extern int unet_count_routes();
extern struct unet_route *unet_get_route(uint32_t id);

#endif
